/**************************************************************************************************
* Title: SumRenderManager.inl
* Author: Gael Huber
* Description: Handles entirety of rendering subsystem.
**************************************************************************************************/

/**************************************************************************************************
* Assign the rendering functions to the job
**************************************************************************************************/
inline void AssignRenderingFunction(Job& job) {
	job = Job(&RenderManager::kickRender, static_cast<void*>(RenderManager::getSingletonPtr()));
	job.setStatus(Job::DONE);
}

/**************************************************************************************************
* Requests the scene render
**************************************************************************************************/
inline void RequestRendering(Job& job) {
	// Set status to pending (we want to ensure status is correct in case this is a reoccuring job
	job.setStatus(Job::PENDING);

	// Add the job to the queue
	JobManager::getSingletonPtr()->addJob(job);
}

/**************************************************************************************************
* Waits for rendering to finish
**************************************************************************************************/
inline void WaitForRendering(Job& job) {
	while(job.getStatus() != Job::DONE)
		Sleep(THREAD_SLEEP_TIME);
}